package com.easydisk.user.feignclient;

import com.easydisk.model.req.AddRootFolderReq;
import com.easydisk.response.ApiResponse;
import com.easydisk.vo.UserFileParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "file-modules", url = "http://localhost:9092/file", configuration = FeignConfiguration.class)
public interface FileFeignClient {

    /**
     * 获取用户root文件夹的rootId和文件夹名称
     * @param fileId
     * @param userId
     * @return
     */
    @GetMapping("/get/info/param")
    public ApiResponse<UserFileParam> getUserFileParam(@RequestParam Long fileId,
                                                       @RequestParam Long userId);

    /**
     * 创建用户root文件夹
     *
     * @param addRootFolderReq
     * @return
     */
    @PostMapping("/add/folder/root")
    public ApiResponse<String> addRootFolder(@RequestBody AddRootFolderReq addRootFolderReq);

}
